home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / MISC / MEMALLOC.PAS next >
Pascal/Delphi Source File  |  1996-07-21  |  812b  |  25 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Memory allocation demonstration
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBMEM;
  10.  
  11. var Allocation1, Allocation2 : AllocationObjectType;
  12.     Data : string;
  13.  
  14.  
  15. begin
  16.      Data := 'Some temporary data to test';
  17.  
  18.      Allocation1.InitializeEmpty;
  19.      Allocation1.MoveIn (@Data, SizeOf(Data), 0);
  20.      Allocation2.InitializeEmpty;
  21.      Allocation2.MoveIn (Allocation1.DataPointer(0), Allocation1.DataSize, 0);
  22.  
  23.      Write (String(Allocation2.DataPointer(0)^), ' = ');
  24.      WriteLn (String(Allocation1.DataPointer(0)^));
  25. end.